package cn.doitedu.producer.high.datasource;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;

public class TestFormat {
    public static void main(String[] args) {

        String template = "{\"user_id\":%s,\"event_id\":\"%s\",\"properties\":{\"f1\":%.2f,\"f2\":%.2f,\"f3\":%.2f}}";

        float v = RandomUtils.nextFloat(10,20);
        System.out.println(v);
        String format = String.format(template, "aa", "bb", v, 44.4434239587, 55.558832489348);

        System.out.println(format);

    }
}
